package study.datastructure.link.leetcode;/**
 * @program: datastructure
 * @author: lcy
 * @create: 2024-10-10 11:48
 */

public class ListNode {
    public int val;
    public ListNode next;

    ListNode() {
    }

    @Override
    public String toString() {
        if (next==null){
            return val+"";
        }
            return +val+","+next;
    }

    public ListNode(int val) {
        this.val = val;
    }

    ListNode(int val, ListNode next) {
        this.val = val;
        this.next = next;
    }
}
